//
//  TotalViewController.m
//  BOSS-SOOC
//
//  Created by apple on 16/8/29.
//  Copyright © 2016年 Gcx. All rights reserved.
//

#import "TotalViewController.h"
#import "TotalTableView.h"
#import "StatisticViewController.h"
#import "TotalDetailViewController.h"

@interface TotalViewController ()<TotalTableViewDelegate>

@end

@implementation TotalViewController

- (void)viewDidLoad{

    [super viewDidLoad];
    [self setNavBarTitle:@"统计"];
    
    self.automaticallyAdjustsScrollViewInsets = YES;
    
    TotalTableView *table = [[TotalTableView alloc]initWithFrame:CGRectMake(0, 44, SIZEWIDTH, SIZEHEIGHT - 44) style:UITableViewStyleGrouped];
    table.sc_delegate = self;
    [self.view addSubview:table];
}

- (void)tableView:(TotalTableView *)tableView didSelectQuexi:(TotalModel *)model{

    StatisticViewController *vc = [[StatisticViewController alloc]getTotalModel:model];
    
    vc.hidesBottomBarWhenPushed = YES;
    
    [self navigationCanDragBack:YES];
    
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)tableView:(TotalTableView *)tableView didSelectDetail:(TotalModel *)model{

    TotalDetailViewController *vc = [[TotalDetailViewController alloc]getTotalModel:model];
    
    vc.hidesBottomBarWhenPushed = YES;
    
    [self navigationCanDragBack:YES];
    
    [self.navigationController pushViewController:vc animated:YES];
}

@end
